<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>批次管理</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  #parse('/headFiles.html')
</head>
<body>
<div class="layui-fluid layui-form" wid100>
  <input type="hidden" name="batchId" value="$!{batchId}"/>
  <div class="layui-form-item">
    <label class="layui-form-label">批次号</label>
    <div class="layui-input-block">
      <div class="layui-form-mid layui-word-aux">$!{batchId}</div>
    </div>
  </div>
  <div class="layui-row">
	<div class="layui-col-xs6">
		<div class="layui-form-item">
		      <label class="layui-form-label">批次起始位</label>
		      <div class="layui-input-block">
		        <div class="layui-form-mid layui-word-aux">$!{startNum}</div>
		      </div>
		  </div>
	</div>
	<div class="layui-col-xs6">
		<div class="layui-form-item">
			  <label class="layui-form-label">批次数量</label>
			  <div class="layui-input-block">
			      <div class="layui-form-mid layui-word-aux">$!{produceTotal}</div>
			  </div>
		  </div>
	</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">设备所属人</label>
    <div class="layui-input-block">
      <select id="userId" name="userId" class="layui-hide" lay-ignore>
        <option value="$!{userId}">$!{userInfo}</option>
      </select>
    </div>
  </div>
  <div class="layui-form-item">
	<div class="layui-input-block">
  		<p class="layui-badge">已部署设备不会被设置</p>
	</div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">设置策略</label>
    <div class="layui-input-block">
      <select name="strategyType">
        <option value="1">跳过已归属已部署的设备</option>
        <option value="2">覆盖已归属未部署的设备</option>
      </select>
    </div>
  </div>
  <div class="layui-form-item">
  	<label class="layui-form-label">设置起始位</label>
  	<div class="layui-input-block">
		<input type="text" name="setStartNum" placeholder="必填项" lay-verify="required"  autocomplete="off" class="layui-input" value="$!{setStartNum}">
  	</div>
  </div>
  <div class="layui-form-item">
	<label class="layui-form-label">设置数量</label>
	<div class="layui-input-block">
		<input type="text" name="setTotal" placeholder="必填项" lay-verify="required"  autocomplete="off" class="layui-input" value="$!{setTotal}">
	</div>
  </div>
  <div class="layui-form-item layui-hide">
    <input type="button" lay-submit lay-filter="LAY-form-submit" id="LAY-form-submit" value="确认">
  </div>
</div>
#parse('/footFiles.html')
<script>
layui.config({
  base: '$!{webRoot}/layuiadmin/'
  ,webRoot:'$!{webRoot}'
  ,resDomain:'$!{resDomain}'
}).extend({
  index: 'lib/index'
}).use(['index', 'form'],function (){
  var $ = layui.$,form = layui.form;

  $('#userId').select2({
    placeholder: "请选择设备归属人",
    width: '250px',
    theme: 'bootstrap',
    allowClear : true,
    ajax: {
      url: layui.setter.webRoot + '/agent/select.data',
      method: 'post',
      delay: 250,
      processResults: function (result) {
        if (result.code == 200) {
          return {
            pagination: {more: result.body.more},
            results: result.body.data || []
          };
        } else {
          return {results: []};
        }
      }
    }
  });
})
</script>
</body>
</html>